<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/6/22 0022
  Time: 12:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/base.jsp"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>成绩编辑</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="${basePath}/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="${basePath}/css/public.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }
        .layui-form{
            width: 50%;
        }
    </style>
</head>
<body>
<div class="layui-form layuimini-form">
    <input type="hidden" name="id" id="id" value="${id}">
    <div class="layui-form-item">
        <label class="layui-form-label required">公告主题</label>
        <div class="layui-input-block">
            <input type="text" name="title" lay-verify="required" lay-reqtext="公告主题不能为空"  value="${ggaoInfo.title}" class="layui-input" autocomplete="off">
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">公告内容</label>
        <div class="layui-input-block">
            <textarea name="text" placeholder="请输入内容" class="layui-textarea" >${ggaoInfo.text}</textarea>
        </div>
    </div>
    <%--    <div class="layui-form-item">
            <label class="layui-form-label required">公告内容</label>
            <div class="layui-input-block">
                <input type="text" name="testscore" lay-verify="required" lay-reqtext="公告内容不能为空"  value="${ggaoInfo.text}" class="layui-input" autocomplete="off">
            </div>
        </div>--%>
<%--    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
        </div>
    </div>--%>
</div>
<script src="${basePath}/lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
<script src="${basePath}/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
    layui.use(['form','jquery'], function () {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.jquery;



        //监听提交
        form.on('submit(saveBtn)', function (data) {

            //发送请求
            $.ajax({
                type:"post",
                url:"${basePath}/ggao/saveeditggao",
                data:data.field,
                dataType:'json',
                success:function(res){
                    if(res.code===0){
                        layer.msg(res.msg,function(){
                            /*刷新列表页面*/
                            parent.window.location.reload();
                        })
                    }else{
                        layer.alert(res.msg);
                    }
                }
            });

            return false;
        });

    });
</script>
</body>
</html>